Optimal. Leaf size=344 \[ \frac {\sqrt {a+b} (A+2 B) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d}-\frac {\sqrt {a+b} (2 a B+A b) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a d}+\frac {A \sin (c+d x) \sqrt {a+b \sec (c+d x)}}{d}+\frac {A (a-b) \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.37, antiderivative size = 344, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4032, 4058, 3921, 3784, 3832, 4004} \[ \frac {\sqrt {a+b} (A+2 B) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d}-\frac {\sqrt {a+b} (2 a B+A b) \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{a d}+\frac {A \sin (c+d x) \sqrt {a+b \sec (c+d x)}}{d}+\frac {A (a-b) \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3784
Rule 3832
Rule 3921
Rule 4004
Rule 4032
Rule 4058
Rubi steps
\begin {align*} \int \cos (c+d x) \sqrt {a+b \sec (c+d x)} (A+B \sec (c+d x)) \, dx &=\frac {A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{d}+\int \frac {\frac {1}{2} (A b+2 a B)+b B \sec (c+d x)-\frac {1}{2} A b \sec ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{d}-\frac {1}{2} (A b) \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx+\int \frac {\frac {1}{2} (A b+2 a B)+\left (\frac {A b}{2}+b B\right ) \sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {A (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{b d}+\frac {A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{d}+\frac {1}{2} (b (A+2 B)) \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx+\frac {1}{2} (A b+2 a B) \int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx\\ &=\frac {A (a-b) \sqrt {a+b} \cot (c+d x) E\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{b d}+\frac {\sqrt {a+b} (A+2 B) \cot (c+d x) F\left (\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{d}-\frac {\sqrt {a+b} (A b+2 a B) \cot (c+d x) \Pi \left (\frac {a+b}{a};\sin ^{-1}\left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}+\frac {A \sqrt {a+b \sec (c+d x)} \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 18.31, size = 1107, normalized size = 3.22 \[ \frac {\sqrt {a+b \sec (c+d x)} \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{\tan ^2\left (\frac {1}{2} (c+d x)\right )+1}} \left (a A \sqrt {\frac {b-a}{a+b}} \tan ^5\left (\frac {1}{2} (c+d x)\right )-A b \sqrt {\frac {b-a}{a+b}} \tan ^5\left (\frac {1}{2} (c+d x)\right )-2 a A \sqrt {\frac {b-a}{a+b}} \tan ^3\left (\frac {1}{2} (c+d x)\right )-2 i A b \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}} \tan ^2\left (\frac {1}{2} (c+d x)\right )-4 i a B \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}} \tan ^2\left (\frac {1}{2} (c+d x)\right )+a A \sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )+A b \sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )-i A (a-b) E\left (i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \left (\tan ^2\left (\frac {1}{2} (c+d x)\right )+1\right ) \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}}+2 i (a-b) B F\left (i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \left (\tan ^2\left (\frac {1}{2} (c+d x)\right )+1\right ) \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}}-2 i A b \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}}-4 i a B \Pi \left (-\frac {a+b}{a-b};i \sinh ^{-1}\left (\sqrt {\frac {b-a}{a+b}} \tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a+b}{a-b}\right ) \sqrt {1-\tan ^2\left (\frac {1}{2} (c+d x)\right )} \sqrt {\frac {-a \tan ^2\left (\frac {1}{2} (c+d x)\right )+b \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}{a+b}}\right )}{\sqrt {\frac {b-a}{a+b}} d \sqrt {b+a \cos (c+d x)} \sqrt {\sec (c+d x)} \sqrt {\frac {\tan ^2\left (\frac {1}{2} (c+d x)\right )+1}{1-\tan ^2\left (\frac {1}{2} (c+d x)\right )}} \left (-b \tan ^4\left (\frac {1}{2} (c+d x)\right )+a \left (\tan ^2\left (\frac {1}{2} (c+d x)\right )-1\right )^2+b\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 49.59, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B \cos \left (d x + c\right ) \sec \left (d x + c\right ) + A \cos \left (d x + c\right )\right )} \sqrt {b \sec \left (d x + c\right ) + a}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sec \left (d x + c\right ) + A\right )} \sqrt {b \sec \left (d x + c\right ) + a} \cos \left (d x + c\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.98, size = 1389, normalized size = 4.04 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \sec \left (d x + c\right ) + A\right )} \sqrt {b \sec \left (d x + c\right ) + a} \cos \left (d x + c\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \cos \left (c+d\,x\right )\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sec {\left (c + d x \right )}\right ) \sqrt {a + b \sec {\left (c + d x \right )}} \cos {\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________